
<?php 
	require_once($_SERVER['DOCUMENT_ROOT'] . '/Prototipo/controle/ComentarioController.php');
	require_once($_SERVER['DOCUMENT_ROOT'] . '/Prototipo/modelo/TipoNoticia.php');
	require_once($_SERVER['DOCUMENT_ROOT'] . '/Prototipo/conexao/ConexaoBanco.php');
	require_once($_SERVER['DOCUMENT_ROOT'] . '/Prototipo/modelo/StatusComentario.php');
	require_once($_SERVER['DOCUMENT_ROOT'] . '/Prototipo/modelo/Usuario.php');
	require_once($_SERVER['DOCUMENT_ROOT'] . '/Prototipo/modelo/TipoUsuario.php');
	$controle = new ComentarioController();
	$tipoNoticia = new TipoNoticia();
	
?>


<form  method="post"  action="<?php $controle->recebePost('cadastrar');?>" class="well">
	<fieldset>
		<legend><h3>Comentar</h3></legend>
			<div >
			<p ><input type="checkbox" name="anonimo" value="1" id="anonimo" onclick="showHide();"> Anônimo</p>
			<p id="nomeComentario">
				<label>Nome</label>
				<input name="nomeComentario" class="input-xxlarge" type="text" id="nomeComentario">
			</p>
			<p id="emailComentario">
				<label>Email</label>
				<input name="emailComentario" class="input-xxlarge" type="email">
			</p>
			</div>
			<p>
				<label>Comentário</label>
				<textarea name="comentario" class="input-xxlarge" cols="42" rows="10" ></textarea>
			</p>
			<p>
				<input type="submit" name="submit" class="btn btn-inverse">
			</p>
	</fieldset>
</form>
<!-- 
<form action="#" method="post">
      <input type="text" name="nome" id="nome" class="nome" value="Nome" onfocus="if (this.value == 'Nome') this.value = '';" onblur="if (this.value == '') this.value = 'Nome';" />
      <input type="text" name="email" id="email" class="email" value="E-mail" onfocus="if (this.value == 'E-mail') this.value = '';" onblur="if (this.value == '') this.value = 'E-mail';" />
      <textarea name="comentario" id="comentario" class="comentario" onfocus="if (this.value == 'Comentário') this.value = '';" onblur="if (this.value == '') this.value = 'Comentário';">Comentário</textarea>
      <div class="retorno"></div>
      <input type="submit" class="btn" value="Enviar" />
</form>
 -->

	<?php //echo date('Y/m/d H:i:s');?>
	
	<div>
		<?php
	    //$sql_conta = mysql_query("SELECT * FROM comentario WHERE noticia_id = '$id' AND status_comentario_id = '1'") or die("Erro ao consultar!");
	    ?>
	    <!-- <p>Comentários (<?php  //echo mysql_num_rows($sql_conta);?>)</p> -->
	
	    <!--  <div class="commentbox">-->
	    <?php
// 					$comment = mysql_query("SELECT * FROM tab_comment WHERE id_post = '$id' AND status = 'ativo'") or die("Erro ao consultar!");
// 				   while($rescomment = mysql_fetch_array($comment)){
				   
// 				   $lowercase = strtolower($rescomment['email']);
// 		           $imagem    = md5($lowercase);
				   
// 				   echo '<li>';
// 				   echo '<img src="http://www.gravatar.com/avatar.php?gravatar_id='.$imagem.'" />';
// 				   echo '<span class="nome2"><b>'.$rescomment['nome'].'</b> em '.$rescomment['data'].'</span>';
// 				   echo '<span class="comentario2">'.$rescomment['comentario'].'</span>';
// 				   echo '</li>';
// 				   }
		?>
	    </div>
	<!--  </div>-->
	
	<?php include 'VerComentarios.php';?>